import { defHttp } from '/@/utils/http/axios';
import { ContentTypeEnum } from '/@/enums/httpEnum';

enum Api {
  getleavePage = '/admin-api/bpm/oa/leave/page',
  addleave = '/admin-api/bpm/oa/leave/create',
  getleave = '/admin-api/bpm/oa/leave/get',
  leaveDelete = '/admin-api/bpm/oa/leave/delete',
}

/**
 * @description: 请假
 */
export const getleavePage = (params: any) => {
  return defHttp.get<any>({ url: Api.getleavePage, params });
};
export const addleave = (params: any) => {
  return defHttp.post<any>({ url: Api.addleave, params });
};
export const getleave = (params: any) => {
  return defHttp.get<any>({ url: Api.getleave, params });
};
export const leaveDelete = (params: any) => {
  return defHttp.delete<any>(
    {
      url: Api.leaveDelete,
      params,
      headers: { 'Content-Type': ContentTypeEnum.FORM_URLENCODED },
    },
    { joinParamsToUrl: true },
  );
};
